from selenium import  webdriver
from selenium.webdriver.chrome.webdriver import WebDriver


class BasePage():
    _url = "https://work.weixin.qq.com/wework_admin/frame"
    def __init__(self,base_driver=None):
        if base_driver is None:
            chrome_arg=webdriver.ChromeOptions()
            chrome_arg.debugger_address='127.0.0.1:9222'
            self.driver=webdriver.Chrome(options=chrome_arg)
            self.driver.get(self._url)
            # self.driver.maximize_window()
            self.driver.implicitly_wait(10)
        else:
            # ：WebDriver是方便IDE使用，写代码的时候可以自动补全，没有其他实际作用
            self.driver:WebDriver=base_driver
